from config.dynamic_configuration import ConfigCenter
from service import MessageCore
from service.ChatService import ChatService
from service.FileService import FileService

if __name__ == '__main__':
    # 获取文件内容
    file_content = FileService.get_file_content(ConfigCenter.get_file_id())

    ask = "请根据我提供给你的参考页面重新输出一份代码"

    code_messages = MessageCore.format_message_content(MessageCore.code_messages, ask)

    # 在 base_messages 里插入 file_content
    messages = code_messages[:1] + [{"role": "system", "content": file_content}] + code_messages[1:]

    message = ChatService.chat(messages)

    print(message.content)
